<?php

App::uses('AppModel', 'Model');

/**
 * Resource Model
 *
 * @property Catagory $Catagory
 */
class Resource extends AppModel {

    var $actsAs = array('Translate' => array(
            'res_name' => 'resnameTranslation',
            'content' => 'contentTranslation'
    ));

    /**
     * Primary key field
     *
     * @var string
     */
    public $primaryKey = 'res_id';
    public $validate = array(
        'res_name' => array(
            'input_resource' => array(
                'rule' => array('notempty'),
                'message' => 'Please enter a resource'),
        ),
        'res_desc' => array(
            'input_description' => array(
                'rule' => array('notempty'),
                'message' => 'Please enter a resource'),
        ),
    );

    /**
     * Display field
     *
     * @var string
     */
    public $displayField = 'res_name';


    //The Associations below have been created with all possible keys, those that are not needed can be removed

    /**
     * belongsTo associations
     *
     * @var array
     */
    public $belongsTo = array(
        'Catagory' => array(
            'className' => 'Catagory',
            'foreignKey' => 'cat_id',
            'conditions' => '',
            'fields' => '',
            'order' => ''
        ),
        'Questionnaire' => array(
            'className' => 'Questionnaire',
            'foreignKey' => 'q_id',
            'conditions' => '',
            'fields' => '',
            'order' => ''
        )
    );

}
